﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Host.InfrasIntructure.Interface
{
    public  interface IBaseRepository<T> where T : class,new()
    {
        IQueryable<T> GetAll();
        IQueryable<T> GetAddAsync(Expression<Func<T, bool>> expression);
        /// <summary>
        /// 根据实体的主键ID异步获取实体。
        /// </summary>
        /// <param name="id">实体的主键ID。</param>
        /// <returns>返回实体，如果找不到则返回null。</returns>
        Task<T> GetByIdAsync(int id);
    }
}
